package com.coursesystem.dao;

import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

@Repository
public class OptionDAO {
    private static final String HASH_NAME = "rc_option";
    private static final String ALLOW_STUDENT_SELECT = "allow_student_select";
    private static final String ALLOW_TEACHER_GRADE = "allow_teacher_grade";
    private Map<String,Boolean> map=new HashMap<>();

    public Boolean getAllowStudentSelect() {
        return (Boolean) get(ALLOW_STUDENT_SELECT);
    }

    public void setAllowStudentSelect(Boolean status) {
        set(ALLOW_STUDENT_SELECT, status);
    }

    public Boolean getAllowTeacherGrade() {
        return (Boolean) get(ALLOW_TEACHER_GRADE);
    }

    public void setAllowTeacherGrade(Boolean status) {
        set(ALLOW_TEACHER_GRADE, status);
    }

    private Boolean get(String key) {
        return map.get(key);
    }

    private void set(String key, Boolean value) {
        map.put(key,value);
    }
}
